Repository navigation
Preserve quota spend index conflict diagnostics - #9180
loopx-agent wants to merge 1 commit into
Conversation
Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
[P2] 已写回的 Turn 在扣额冲突后,提示指向无法直接执行的写回模板。 在 File 和 SQLite 上提交原始写回,取得 settlement_owed.command,再让独立 spend 在该命令的预览与提交之间推进 run index。候选正确返回 index_digest_conflict 和 appended=false。按新提示用原 Goal、Agent、Turn 重跑 Codex App 的 quota should-run,返回 normal_run,保留原 effect,但没有 settlement_owed。给出的 next_cli_actions 只有带 <scale> 等占位符的 refresh-state 模板,原样执行两侧均退出 2。用已保存的原 settlement_owed.command 两侧均可结算,重放没有第二次扣额。请让冲突响应或其明确指向的同 Turn 读回路径投影现有回执负责的原扣额命令,并让回归从错误响应开始走到该命令。 新恢复提示 现有扣额命令 owner
动机 / Motivation
执行已完成写回的 Agent 遇到并发扣额冲突时,需要确认本次请求确已被拒绝,并继续同一次结算。基线把确定的竞争拒绝显示为通用状态采集错误,无法解释该执行是否写入。候选已修正诊断和零追加标志,真正按提示找回原扣额命令仍未闭环。评审覆盖真实本地 CLI 和隔离 File、SQLite,正式安装 Host 与其它受支持后端未实测。给定原扣额命令的回归已通过,续页和重读入口仍要能把该命令交给执行者。
改动思路 / Approach
保留现有事务拒绝与回执 owner,由 CLI 投影准确的失败原因。复用现有已验证回执的命令编排,保持原 effect,并让恢复入口只要求它已经持有的身份。评审覆盖真实本地 CLI 和隔离 File、SQLite,正式安装 Host 与其它受支持后端未实测。
具体改动 / Changes
精确提交 e82b86a53005afe54b2c5ec37ce1bfbbedbcaf41,基线 64353773dc8b1ca82ff531cc7653dec6c3d41c0b。一笔签署提交,四个文件 +75/-9。 回执契约
- typed-rejection 已通过。事务拒绝继续使用共享的
QuotaRunIndexConflict,CLI 继承同一 reason code,回读确认只有竞争请求追加。 - same-effect-once 已通过。执行已经可用的原扣额命令可收口一次,重复执行给出原结算身份并且不追加。
- recovery-guidance 待修。候选测试通过再次运行已有写回取得旧命令。本评审从 CLI 错误引导首次读回,确认普通 Codex App 结果只给后续写回模板,遗漏可直接执行的既有扣额命令。
对主干的风险 / Risks
作者新增回归在基线两侧均为通用错误,在候选两侧通过。补做真实 CLI 竞争序列,File 和 SQLite 都复现提示缺口,原始扣额命令在同两条链路均成功收口且重放无追加。标准本机 premerge 的 6 项直接检查与 16 项选中检查通过。词表检查最初缺 TypeScript 依赖,复用同 lockfile 的现有依赖后通过。输出预算 smoke 初跑超时,单独重跑通过。无绑定扣额的两条独立竞争用例也通过,重新预览后可继续。扩展测试最初在仓库内建临时目录,导致两条 gitless 用例在基线与候选同因失败。移到仓库外后,两侧四例均通过。未查询托管 CI。
我的整体评价 / Verdict
REQUEST_CHANGES。 保留类型化冲突诊断。按文档公开的原结算身份,从失败响应走到可执行的已有扣额命令,并在回归中核对这一入口和仅一次扣额。
English verdict: REQUEST_CHANGES at e82b86a. The CLI correctly identifies the rejected spend, but the advertised same-Turn recovery returned only a placeholder writeback template on both File and SQLite.
Goal and delivered outcome
A competing quota spend can change the run index after the CLI has collected its preview. The existing transaction rejects that stale spend with
index_digest_conflict, but the CLI currently reports a generic collection failure and suggests repairing status collection.The CLI now projects the existing conflict code, reports that the rejected spend appended nothing, and points callers to the original settlement command for bound work. Both callers share the existing exception type. The accounting transaction continues to own the index check and single-debit rules.
This complements the managed-driver handling in #6449 and follows the receipt-backed settlement contract.
Author declaration
64353773dc8b1ca82ff531cc7653dec6c3d41c0b.appended=false.settled; repeating it leaves the debit count unchanged.Validation
e82b86a53005afe54b2c5ec37ce1bfbbedbcaf41finished; input classsyntheticregression_paritypassedreal_entrypointpassedstaticpassedstaticfailed_compact_quota_failureat both base and head.staticpassedintegrationrunningThe tests exercise the source checkout and the real local accounting transaction. Installed runtime and Windows qualification remain with their release and CI owners. The bounded refactor colocates the existing exception and its mapping.
Type and scope
none